package org.enwey.icarenew.APPUtils;

import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by enwey on 2014/11/21.
 */
public class ToastUtil {
    private static Toast toast;

    private static void show(Context context, int messageId) {
        if (context == null) {
            return;
        }
        show(context, context.getString(messageId));
    }

    public static void show(Context context, String message) {
        if (context == null || TextUtils.isEmpty(message)) {
            return;
        }

        if (toast == null) {
            toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
        }
        toast.setText(message);
        toast.show();
    }
}
